home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 API Bible / Windows 95 API Bible 3 Disc Set.iso / Win32 API Bible Book 1 of 3.iso / chapte26 / ex2.c < prev    next >
C/C++ Source or Header  |  1995-05-29  |  755b  |  26 lines

  1. #include <genstub.c>
  2.  
  3. LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
  4. {
  5.    char szBuffer[128];
  6.    switch (uMsg)
  7.    {
  8.          case WM_DESTROY:
  9.                PostQuitMessage( 0 );
  10.                break;
  11.          case WM_COMMAND:
  12.                switch ( LOWORD( wParam ) )
  13.                {
  14.                      case IDM_TEST:
  15.                            Beep( GetTickCount() % ( 32767 - 37 ), 100 );
  16.                            break;
  17.                      case IDM_EXIT:
  18.                            DestroyWindow( hWnd );
  19.                            break;
  20.                }
  21.                break;
  22.          default:
  23.                return (DefWindowProc(hWnd, uMsg, wParam, lParam));
  24.    }
  25.    return (NULL);
  26. }